package com.ss.android.wenda.a;

import com.bytedance.retrofit2.Call;
import com.bytedance.retrofit2.Callback;
import com.ss.android.topic.e.b.a;
import com.ss.android.topic.e.bb;
import com.ss.android.wenda.model.response.f;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

public final class h extends bb {
    private String f;
    private String g;
    private String h;

    public h(String arg1, String arg2, String arg3) {

        this.g = arg2;
        this.f = arg1;
        this.h = arg3;
    }

    private void a(f arg4, List arg5) {
        if(arg4 != null && arg5 != null) {
            if(this.isFirstPageLoading()) {
                arg5.clear();
            }

            Iterator v1 = arg4.c.iterator();
            while(v1.hasNext()) {
                Object v0 = v1.next();
                if(arg5.contains(v0)) {
                    continue;
                }

                arg5.add(v0);
            }
        }
    }

    public final void a(a arg1, List arg2) {
        this.a(((f)arg1), arg2);
    }

    public final void onLoadItemFromResponse(Object arg1, List arg2) {
        this.a(((f)arg1), arg2);
    }

    public final Call onCreateCall() {
        HashMap v1 = new HashMap();
        v1.put("count", "20");
        v1.put("qid", this.f);
        v1.put("gd_ext_json", this.h);
        if(!android.support.design.a.isTextEmpty(this.g)) {
            v1.put("api_param", this.g);
        }

        String v2 = "offset";
        int v0 = this.mLatestPage == null || (this.isFirstPageLoading()) ? 0 : ((com.ss.android.wenda.model.response.f)this.mLatestPage).d;
        v1.put(v2, String.valueOf(v0));
        return new com.ss.android.wenda.a.f(((Map)v1), ((Callback)this));
    }
}

